<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">
    <h:head>
        <title>Pedido de Pastel</title>
    </h:head>
    <h:body>
        <h:form>
            <div>
                <h4>Faça seu Pedido</h4>
                <br/>
                Cliente: <h:inputText value="#{bean.cliente}"/>
                <br/><br/>
                Tipo: 
                <h:selectOneRadio id="tipo" layout="pageDirection" value="#{bean.tipoCliente}">
                    <f:selectItems value="#{bean.tipo}"/>
                </h:selectOneRadio>
                <br/>
                Você conheceu o pastel:
                <h:selectManyCheckbox id="influencia" layout="pageDirection" value="#{bean.influenciaCliente}">
                    <f:selectItems value="#{bean.influencia}"/>
                </h:selectManyCheckbox>
                <br/>
                Sabor:
                <br/>
                <h:selectManyListbox value="#{bean.listaPastel}">
                    <f:selectItems var="pastel" value="#{bean.listaPastel}"
                                   itemLabel="#{pastel.nome}" itemValue="#{pastel.nome}"/>
                </h:selectManyListbox>
                <br/><br/>
                Pasteis:
                <br/>
                <div>
                    <h:dataTable var="pastel" value="#{bean.listaPastel}">
                        <h:column>
                            <f:facet name="header">
                                Sabor
                            </f:facet>
                            #{pastel.nome}
                        </h:column>
                        <h:column>
                            <f:facet name="header">
                                Valor
                            </f:facet>
                            #{pastel.preco}
                        </h:column>
                    </h:dataTable>
                </div>
                <br/><br/>
                <h:commandButton value="Ok"/>
                <h:commandButton value="Limpar"/>
        </div>
        </h:form>
    </h:body>
</html>

